import request from "./request";

//获取全部的普通用户
export function getAllUser() {
  return request.get('find_user_by_kind?userKind=0');
}
//根据用户名查询用户详情
export function getUserByUserName(userName) {
  return request.post("/api/user/findbyusername",{
    userName,
  })
}
// 管理员更新
export function adminUpdate(adminObj) {
  return request.post('update_user',{
    id:adminObj.id,
    password:adminObj.password,
    nickname:adminObj.nickname,
    userPortrait: adminObj.adminIcon
    // adminSex: adminObj.sex,
    // adminPortrait: adminObj.adminIcon,
    // realName: adminObj.realName,
    // adminPhone: adminObj.phone,
  })
}

//根据用户名删除用户
export function deleteUserByUserName(userName) {
  return request.delete(`/api/user/delete/${userName}`);
}
//分页查询用户
export function findUserByLimit(pagenumber,limit) {
  return request.get('/api/user/limituser',{
    params:{
      pagenumber,
      limit
    }
  })
}
